<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .div-tips{
            position: relative;
            top: 50px;
            left: 50px;
            width: 200px;
            line-height: 40px;
            border:1px solid #ccc;
            cursor: pointer;
        }
        .div-tips:hover:before{
            content:"";
            border:5px solid #000000;
            border-left-color:transparent;
            border-right-color:transparent;
            border-bottom-color:transparent;
            width:0;
            height:0;
            position:absolute;
            left: 10px;
            top: -5px;
        }
        .div-tips:hover:after{
            content:attr(data-msg);
            position:absolute;
            font-size: 12px;
            line-height:25px;
            text-align:center;
            left:0;
            bottom:calc(100% + 5px);
            white-space: nowrap;
            padding: 0 5px;
            border-radius: 3px;
            color: white;
            background: black;
        }
    </style>
</head>
<body>
<div data-msg="提示信息哦" class="div-tips">鼠标经过显示提示信息</div>
</body>
</html>